home *** CD-ROM | disk | FTP | other *** search
/ PowerPlay 1997 March / PowerPlay0397.iso / T-ONLINE / SHOW / XTRAS / FFXTRAS / -FFVERIF.DIR / 00001_Script_FF Wrappers next >
Text File  |  1996-03-15  |  9KB  |  358 lines

  1. -- Copyright 1992-1996 David Gewirtz under license to Component Software Corp. 
  2. -- All rights reserved worldwide.
  3. -- This file corresponds to FileFlex v2.0
  4.  
  5. ------------------------------------------------------------------------------------------------------------------------
  6. -- Following are the only wrapper scripts you should consider modifying.  In Director 5 and
  7. -- above, FileFlex has been implemented as a Director-native Xtra.  By placing the FileFlex
  8. -- engine inside your Xtras folder (this is in the same directory/folder as your Director 
  9. -- application or your projector application, FileFlex will be automatically loaded.  If, for
  10. -- some reason, you choose to place the FileFlex engine somewhere else, then you'll need
  11. -- to modify the following wrapper scripts to locate and open FileFlex.  Note that we will
  12. -- not provide technical support to users choosing to use this method.
  13. ------------------------------------------------------------------------------------------------------------------------
  14.  
  15. on DBInitPlatform
  16.   global gDBGlobalPtr1030
  17.   put empty into gDBGlobalPtr1030
  18.   --openXlib "FileFlex Engine"  --<---------------------------- Be sure your pathspec is correct
  19. end DBInitPlatform
  20.  
  21. on DBClosePlatform
  22.   --closeXlib "FileFlex Engine"  --<---------------------------- Be sure your pathspec is correct
  23. end DBClosePlatform
  24.  
  25.  
  26. ------------------------------------------------------------------------------------------------------------------------
  27. -- Following here are the individual wrapper functions that control access to 
  28. -- the FileFlex engine.  We strongly recommend you change these only with
  29. -- great care.
  30. ------------------------------------------------------------------------------------------------------------------------
  31.  
  32. on DBVersion
  33.   return FileFlex("0")
  34. end DBVersion
  35.  
  36. on DBCopyright
  37.   return FileFlex("999")
  38. end DBCopyright
  39.  
  40. on DBOpenSession
  41.   global gDBActive1030
  42.   if gDBActive1030 <> "true" then
  43.     put "true" into gDBActive1030
  44.     return FileFlex("1")
  45.   else
  46.     return "0"
  47.   end if
  48. end DBOpenSession
  49.  
  50. on DBCloseSession
  51.   global gDBActive1030
  52.   if gDBActive1030 = "true" then
  53.     put "" into gDBActive1030
  54.     return FileFlex("2")
  55.   else
  56.     return "0"
  57.   end if
  58. end DBCloseSession
  59.  
  60. on DBUse dbName, pathspec
  61.   DBCheckActive
  62.   if the paramCount = 1 then
  63.     return FileFlex("3",dbName)
  64.   else
  65.     return FileFlex("3",dbName,pathspec)
  66.   end if
  67. end DBUse
  68.  
  69. on DBDatabaseExists dbName, pathspec
  70.   DBCheckActive
  71.   if the paramCount = 1 then
  72.     return FileFlex("43",dbName)
  73.   else
  74.     return FileFlex("43",dbName,pathspec)
  75.   end if
  76. end DBUse
  77.  
  78. on DBClose dbID
  79.   DBCheckActive
  80.   return FileFlex("4",string(dbID))
  81. end DBClose
  82.  
  83. on DBSelect dbID
  84.   DBCheckActive
  85.   return FileFlex("5",string(dbID))
  86. end DBSelect
  87.  
  88. on DBCloseAll
  89.   DBCheckActive
  90.   return FileFlex("6")
  91. end DBCloseAll
  92.  
  93. on DBUseIndex indexName, pathspec
  94.   DBCheckActive
  95.   if the paramCount = 1 then
  96.     return FileFlex("7",indexName)
  97.   else
  98.     return FileFlex("7",indexName, pathspec)
  99.   end if
  100. end DBUseIndex
  101.  
  102. on DBCloseIndex indexID
  103.   DBCheckActive
  104.   return FileFlex("8",string(indexID))
  105. end DBCloseIndex
  106.  
  107. on DBSelectIndex indexID
  108.   DBCheckActive
  109.   return FileFlex("9",string(indexID))
  110. end DBSelectIndex
  111.  
  112. on DBGo recnum
  113.   DBCheckActive
  114.   return FileFlex("10",string(recnum))
  115. end DBGo
  116.  
  117. on DBTop
  118.   DBCheckActive
  119.   return FileFlex("11")
  120. end DBTop
  121.  
  122. on DBBottom
  123.   DBCheckActive
  124.   return FileFlex("12")
  125. end DBBottom
  126.  
  127. on DBSeek seekExpr
  128.   DBCheckActive
  129.   return FileFlex("13",seekExpr)
  130. end DBSeek
  131.  
  132. on DBSkip num
  133.   DBCheckActive
  134.   return FileFlex("14",string(num))
  135. end DBSkip
  136.  
  137. on DBDeleteRecs startRec, endRec
  138.   DBCheckActive
  139.   return FileFlex("15",string(startRec), string(endRec))
  140. end DBDeleteRecs
  141.  
  142. on DBRecallRecs startRec, endRec
  143.   DBCheckActive
  144.   return FileFlex("16",string(startRec), string(endRec))
  145. end DBDeleteRecs
  146.  
  147. on DBZapRecs startRec, endRec
  148.   DBCheckActive
  149.   return FileFlex("17",string(startRec), string(endRec))
  150. end DBZapRecs
  151.  
  152. on DBPack
  153.   DBCheckActive
  154.   return FileFlex("18")
  155. end DBPack
  156.  
  157. on DBCount
  158.   DBCheckActive
  159.   return FileFlex("19")
  160. end DBCount
  161.  
  162. on DBRecordDeleted recNum
  163.   DBCheckActive
  164.   return FileFlex("20", string(recNum))
  165. end DBRecordDeleted
  166.  
  167. on DBCurrRecNum
  168.   DBCheckActive
  169.   return FileFlex("21")
  170. end DBCurrRecNum
  171.  
  172. on DBSum numFieldName
  173.   DBCheckActive
  174.   return FileFlex("22",numFieldName)
  175. end DBSum
  176.  
  177. on DBAverage numFieldName
  178.   DBCheckActive
  179.   return FileFlex("22", numFieldName) / FileFlex("19")
  180. end DBAverage
  181.  
  182. on DBGetMemo memoField, encryptFlag, key
  183.   DBCheckActive
  184.   if the paramCount = 1 then
  185.     return FileFlex("24", memoField)
  186.   else
  187.     return FileFlex("24", memoField, encryptFlag, key)
  188.   end if
  189. end DBGetMemo
  190.  
  191. on DBWriteMemo memoField, memoVal, encryptFlag, key
  192.   DBCheckActive
  193.   if the paramCount <= 2 then
  194.     return FileFlex("25",memoField, memoVal)
  195.   else
  196.     return FileFlex("25",memoField, memoVal, encryptFlag, key)
  197.   end if
  198. end DBWriteMemo
  199.  
  200. on DBGetFieldByName fieldName, decryptFlag, key
  201.   DBCheckActive
  202.   if the paramCount  = 1 then
  203.     return FileFlex("26",fieldName)
  204.   else
  205.     return FileFlex("26",fieldname, decryptFlag, key)
  206.   end if
  207. end DBGetFieldByName
  208.  
  209. on DBGetFieldByNum fieldName, decryptFlag, key
  210.   DBCheckActive
  211.   if the paramCount  = 1 then
  212.     return FileFlex("27",string(fieldName))
  213.   else
  214.     return FileFlex("27",string(fieldname), decryptFlag, key)
  215.   end if
  216. end DBGetFieldByNum
  217.  
  218. on DBGetCurrRecVal containerType, decryptList, key
  219.   DBCheckActive
  220.   if the paramCount = 1 then
  221.     return FileFlex("28",containerType)
  222.   else
  223.     return FileFlex("28", containerType, decryptList, key)
  224.   end if
  225. end DBGetCurrRecVal
  226.  
  227. on DBListFields
  228.   DBCheckActive
  229.   return FileFlex("29")
  230. end DBListFields
  231.  
  232. on DBMaxRecs
  233.   DBCheckActive
  234.   return FileFlex("47")
  235. end DBMaxRecs
  236.  
  237. on DBFileFlexFolder
  238.   DBCheckActive
  239.   return FileFlex("48")
  240. end DBFileFlexFolder
  241.  
  242. on DBWriteRec containerType, recNum, p0, p1, p2
  243.   if the paramCount = 2 then
  244.     return FileFlex("30",containerType,string(recNum))
  245.   else if the paramCount = 3 then
  246.     return FileFlex("30",containerType, string(recNum), string(p0))
  247.   else if the paramCount = 4 then
  248.     return FileFlex("30",containerType,string(recNum), string(p0), string(p1))
  249.   else
  250.     return FileFlex("30",containerType, string(recNum), string(p0), string(p1),string(p2))
  251.   end if
  252. end DBWriteRec
  253.  
  254. on DBCreateIndex indexName, indexExpr, unique, safety
  255.   DBCheckActive
  256.   return FileFlex("31",indexName, indexExpr, string(unique), string(safety))
  257. end DBCreateIndex
  258.  
  259. on DBReindex indexID
  260.   DBCheckActive
  261.   return FileFlex("32", string(indexID))
  262. end DBReindex
  263.  
  264. on DBIndexExpr indexID
  265.   DBCheckActive
  266.   return FileFlex("44", string(indexID))
  267. end DBIndexExpr
  268.  
  269. on DBBuildSeekExpr
  270.   DBCheckActive
  271.   put "FileFlex(" & quote & "45" & quote into theFunc
  272.   repeat with i = 1 to the paramCount
  273.     put "," & quote & string(param(i)) & quote after theFunc
  274.   end repeat
  275.   put ")" after theFunc
  276.   return value(theFunc)
  277. end DBBuildSeekExpr
  278.  
  279. on DBListIndexFields indexID, delim
  280.   DBCheckActive
  281.   return FileFlex("46", string(indexID),string(delim))
  282. end DBListIndexFields
  283.  
  284. on DBCreate dbName, numFields, fields, safety
  285.   DBCheckActive
  286.   return FileFlex("33", dbName, string(numFields), fields,string(safety))
  287. end DBCreate
  288.  
  289. on DBCheckIndex indexID
  290.   DBCheckActive
  291.   return FileFlex("34", string(indexID))
  292. end DBCheckIndex
  293.  
  294. on DBQuery expr
  295.   DBCheckActive
  296.   return FileFlex("35",expr)
  297. end DBQuery
  298.  
  299. on DBLocate expr
  300.   -- NOTE: DBLocate is obsolete and will be eliminated in future releases
  301.   -- DBLocate has been replaced by DBQuery
  302.   DBCheckActive
  303.   return FileFlex("35",expr)
  304. end DBLocate
  305.  
  306. on DBCurrDBNum
  307.   DBCheckActive
  308.   return FileFlex("36")
  309. end DBCurrDBNum
  310.  
  311. on DBEncrypt theString, key
  312.   DBCheckActive
  313.   return FileFlex("38",theString, key)
  314. end DBEncrypt
  315.  
  316. on DBDecrypt theString, key
  317.   DBCheckActive
  318.   return FileFlex( "39", theString, key)
  319. end DBDecrypt
  320.  
  321. on DBFindMemo memoField, theString
  322.   DBCheckActive
  323.   return FileFlex("40",memoField, theString)
  324. end DBFindMemo
  325.  
  326. on DBConvertCRLF theString, theOption
  327.   DBCheckActive
  328.   if the paramCount = 1 then
  329.     return FileFlex("41",theString)
  330.   else
  331.     return FileFlex("41",theString, theOption)
  332.   end if
  333. end DBConvertCRLF
  334.  
  335. on DBPlatform
  336.   DBCheckActive
  337.   return FileFlex("42")
  338. end DBPlatform
  339.  
  340. on DBCheckActive
  341.   global gDBActive1030
  342.   if gDBActive1030 <> "true" then
  343.     put DBOpenSession() into dummy
  344.   end if
  345. end DBCheckActive
  346.  
  347. -- These routines should never be called by the user.  They simply
  348. -- assign and gather values of the global variables.  They are here so
  349. -- we can test the global value interface to the host application
  350. --
  351. on DBSetGlobal globName, globVal
  352.   return FileFlex("202",string(globName),string(globVal))
  353. end DBSetGlobal
  354.  
  355. on DBGetGlobal globName
  356.   return FileFlex("201",string(globName))
  357. end DBGetGlobal
  358.